{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Pressure, Temperature, phi(stoichiometric ratio)\n",
    "one_atm = 101325\n",
    "TempMax = 800#K\n",
    "TempMin = 800 ; #K\n",
    "\n",
    "PressureMax = 4e6; # Pa\n",
    "PressureMin = 100; # Pa"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "Npp = 1\n",
    "Npt = 10\n",
    "N = Npp * Npt\n",
    "pressure    = np.linspace(PressureMin, PressureMax, Npp) #\n",
    "temperature = np.linspace(TempMin, TempMax, Npt)\n",
    "p, temp = np.meshgrid(pressure, temperature)\n",
    "p    = p.reshape(np.size(p)) #flatten()\n",
    "temp = temp.reshape(np.size(temp))#flatten()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "Nvar = 7\n",
    "sample = np.zeros([N,Nvar])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "for i in range(N):\n",
    "    sample[i,0] = temp[i]\n",
    "    sample[i,1] = p[i]\n",
    "    sample[i,2] = 7.7844347925e-06\n",
    "    sample[i,3] = 0.17014201838 \n",
    "    sample[i,4] = 0.82985014998 \n",
    "    sample[i,5] = 2.3600168646e-08\n",
    "    sample[i,6] = 2.3600168646e-08"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "savedir = 'inputs/'\n",
    "header_fuel = \"T P C3H8 O2 HE CH3CH2CH2 CH3CHCH3\"\n",
    "np.savetxt(savedir+'/sample.dat',sample,header=header_fuel,comments='')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "ReactionNumber = [1]\n",
    "Nparameter = len(ReactionNumber);\n",
    "Ndim=Nparameter\n",
    "sampleParam = np.vstack((Ndim*[1],Ndim*[1],Ndim*[1])) # reference sample \n",
    "for sp in range(1,N):\n",
    "    sampleParam = np.vstack((sampleParam, [1], Ndim*[1], Ndim*[1]))\n",
    "header =\"\"\n",
    "for Reac in ReactionNumber:\n",
    "    header += str(Reac) + \" \"\n",
    "np.savetxt(savedir + '/Factors.dat',sampleParam,header=header,comments='')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
